import fs from 'fs'

const readStream = fs.createReadStream('./aaa.txt', {
    start: 8, // 从字节位置8开始读取
    end: 22, // 读取到字节位置22结束（包括22）
    highWaterMark: 3 // 每次读取3个字节
   });

readStream.on('data', (data) => {
    console.log(data.toString());
    readStream.pause(); // 暂停读取
    setTimeout(() => {
    readStream.resume(); // 恢复读取
    }, 2000); // 暂停2秒后恢复读取
   });
   